#ifndef SYSTEM_H
#define SYSTEM_H

#include "apm32f0xx.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    /* AHB Peripheral*/
    CLK_DMA = 0,
    CLK_SRAMEN = 2,
    CLK_FMCEN = 4,
    CLK_CRCEN = 6,
    CLK_GPIOA = 17,
    CLK_GPIOB = 18,
    CLK_GPIOC = 19,
    CLK_GPIOD = 20,
    CLK_GPIOF = 22,

    /* APB1 Peripheral*/
    CLK_TMR3 = 1 + 32,
    CLK_TMR6 = 4 + 32,
    CLK_TMR7 = 5 + 32,
    CLK_TMR14 = 8 + 32,
    CLK_WWDT = 11 + 32,
    CLK_SPI2 = 14 + 32,
    CLK_USART2 = 17 + 32,
    CLK_USART3 = 18 + 32,
    CLK_USART4 = 19 +32,
    CLK_USART5 = 20 + 32,
    CLK_I2C1 = 21 + 32,
    CLK_I2C2 = 22 + 32,
    CLK_PMU = 28 + 32,

    /* APB2 Peripheral*/
    CLK_SYSCFG = 0 + 64,
    CLK_USART6 = 5 + 64,
    CLK_ADC = 9 + 64,
    CLK_TMR1 = 11 + 64,
    CLK_SPI1 = 12 + 64,
    CLK_USART1 = 14 + 64,
    CLK_TMR15 = 16 + 64,
    CLK_TMR16 = 17 + 64,    
    CLK_TMR17 = 18 + 64,
    CLK_DBG = 22 + 64,


}PeripheralClock_t;


void System_setPeripheralClockEnable(PeripheralClock_t clock,BOOL status);


#ifdef __cplusplus
}
#endif

#endif
